/*
 * Copyright (c) 2002-2003 by OpenSymphony
 * All rights reserved.
 */
package org.jackysoft.workflow.util;

import java.util.Map;

import org.jackysoft.service.OsVariableService;
import org.jackysoft.workflow.FunctionProvider;
import org.jackysoft.workflow.WorkflowContext;

/**
 * Sets the transient variable "caller" to the current user executing an action.
 * 
 * @author <a href="mailto:plightbo@hotmail.com">Pat Lightbody</a>
 * @version $Revision: 1.4 $
 */
public class Caller implements FunctionProvider {
	// ~ Methods
	// ////////////////////////////////////////////////////////////////

	@Override
	public void execute(Map transientVars, Map args, OsVariableService vservice) {
		WorkflowContext context = (WorkflowContext) transientVars
				.get("context");
		transientVars.put("caller", context.getCaller());
	}
}
